package com.laery0.xixin.controller;


import com.laery0.xixin.po.ResponseBean;
import com.laery0.xixin.po.Setmeal;
import com.laery0.xixin.service.SetmealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/setmeal")
public class SetmealController {
    @Autowired
	private SetmealService setmealService;
	
	@PostMapping("/type")
	public ResponseBean<List<Setmeal>> listSetmealByType(@RequestBody Setmeal setmeal) {
		return setmealService.listSetmealByType(setmeal.getType());
	}
	
	@PostMapping("/id")
	public ResponseBean<Setmeal> getSetmealById(@RequestBody Setmeal setmeal) {
		return setmealService.getSetmealById(setmeal.getSmId());
	}
}
